#include "displaylabel.h"
#include <iostream>
#include <opencv2/highgui.hpp>
DisplayLabel::DisplayLabel(QWidget *parent) : QLabel(parent)
{
    this->setStyleSheet("border:2px solid red;");
    this->setAlignment(Qt::AlignLeft);
}
void DisplayLabel::loadImage(const cv::Mat &image)
{
    if(image.empty()){
        throw "no image";
    }
    QImage Qtemp = QImage(static_cast<const unsigned char*>(image.data), image.cols, image.rows, image.step, QImage::Format_Grayscale8);
    this->setPixmap(QPixmap::fromImage(Qtemp));
    //this->resize(Qtemp.size());

}
